package com.huilian.iotbox.data.service.impl;

import com.huilian.iotbox.data.dao.UserCommonDao;
import com.huilian.iotbox.data.po.User;
import com.huilian.iotbox.data.service.UserCommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chenqiwen
 * @CreateDate: 2022-05-17-10-45
 * @Description:
 */
@Service("userInfoService")
public class UserCommonServiceImpl implements UserCommonService {

    @Autowired
    private UserCommonDao userCommonDao;

    @Override
    public List<User> findAllUserByParentId(Integer userId) {
        return userCommonDao.findAllUserByParentId(userId);
    }

    @Override
    public User getOfficialAccountOpenId(Integer userId) {
        return userCommonDao.getOfficialAccountOpenId(userId);
    }

    @Override
    public List<User> findOfficialOrAppletAccountOpenIdByUserId(Integer userId) {
        return userCommonDao.findOfficialOrAppletAccountOpenIdByUserId(userId);
    }

    @Override
    public User findById(Integer id) {
        return userCommonDao.findById(id);
    }

    @Override
    public Integer checkUserName(String username, Integer status) {
        return userCommonDao.checkUserName(username, status);
    }

}
